home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 May / maximum-cd-1999-05.iso / Canvas 6 / DATA1.CAB / English_Tutorial_Files / Viewpage / ColVecItm.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-04  |  1.2 KB  |  68 lines

  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.awt.Polygon;
  4. import java.awt.Rectangle;
  5. import java.io.DataInputStream;
  6. import java.io.IOException;
  7.  
  8. abstract class ColVecItm extends ColObj {
  9.    protected int m_penSz = 1;
  10.    protected int m_penMode;
  11.    protected int m_numSegs;
  12.    protected int m_itemType;
  13.    protected Color m_fillClr;
  14.    protected Color m_frameClr;
  15.    protected Polygon m_poly;
  16.    protected float[] m_ptArryX;
  17.    protected float[] m_ptArryY;
  18.    protected ColGrph m_colGraphicObj;
  19.    public Rectangle m_bounds = new Rectangle();
  20.  
  21.    public void drawPoly(Graphics var1) {
  22.       if (this.m_fillClr != null) {
  23.          if (this.m_colGraphicObj.m_overrideColor != null) {
  24.             var1.setColor(this.m_colGraphicObj.m_overrideColor);
  25.          } else {
  26.             var1.setColor(this.m_fillClr);
  27.          }
  28.  
  29.          var1.fillPolygon(this.m_poly);
  30.       }
  31.  
  32.       if (this.m_frameClr != null) {
  33.          if (this.m_colGraphicObj.m_overrideColor != null) {
  34.             var1.setColor(this.m_colGraphicObj.m_overrideColor);
  35.          } else {
  36.             var1.setColor(this.m_frameClr);
  37.          }
  38.  
  39.          var1.drawPolygon(this.m_poly);
  40.       }
  41.  
  42.    }
  43.  
  44.    public int getType() {
  45.       return this.m_itemType;
  46.    }
  47.  
  48.    public ColVecItm(DataInputStream var1, int var2, ColGrph var3) throws IOException {
  49.       this.m_colGraphicObj = var3;
  50.       if ((var2 & 1) != 0) {
  51.          this.m_fillClr = new Color(var1.readInt());
  52.       }
  53.  
  54.       if ((var2 & 2) != 0) {
  55.          this.m_frameClr = new Color(var1.readInt());
  56.       }
  57.  
  58.       if ((var2 & 4) != 0) {
  59.          this.m_penSz = var1.readInt();
  60.       }
  61.  
  62.       if ((var2 & 64) != 0) {
  63.          this.m_penMode = var1.readInt();
  64.       }
  65.  
  66.    }
  67. }
  68.